import { Link, Route, Switch, Redirect } from 'react-router-dom'
import RankingDetail from './RankingDetail'

export default function Ranking() {
  return (
    <div>
      <nav>
        <Link className='me-3' to='/findmusic/ranking/detail?id=bsb&age=18'>
          飙升榜
        </Link>
        <Link className='me-3' to='/findmusic/ranking/detail?id=xgb&age=19'>
          新歌榜
        </Link>
        <Link className='me-3' to='/findmusic/ranking/detail?id=ycb&age=20'>
          原创榜
        </Link>
      </nav>
      <Switch>
        <Redirect
          from='/findmusic/ranking'
          to='/findmusic/ranking/detail?id=bsb&age=18'
          exact
        />
        <Route path='/findmusic/ranking/detail' component={RankingDetail} />
      </Switch>
    </div>
  )
}
